<template>
  <div class="dashboard-container">
    <h2>仪表盘</h2>
    <div class="stats-cards">
      <div class="stat-card">
        <div class="stat-value">128</div>
        <div class="stat-label">总用户数</div>
      </div>
      <div class="stat-card">
        <div class="stat-value">¥25,380</div>
        <div class="stat-label">本月收入</div>
      </div>
      <div class="stat-card">
        <div class="stat-value">85%</div>
        <div class="stat-label">完成率</div>
      </div>
      <div class="stat-card">
        <div class="stat-value">16</div>
        <div class="stat-label">待处理任务</div>
      </div>
    </div>
    <div class="dashboard-content">
      <div class="chart-section">
        <h3>销售趋势</h3>
        <div class="chart-placeholder">
          <p>图表将在这里显示</p>
        </div>
      </div>
      <div class="recent-activities">
        <h3>最近活动</h3>
        <div class="activity-list">
          <div class="activity-item">
            <span class="activity-time">今天 10:23</span>
            <span class="activity-content">新用户注册</span>
          </div>
          <div class="activity-item">
            <span class="activity-time">今天 09:45</span>
            <span class="activity-content">订单 #12345 已完成</span>
          </div>
          <div class="activity-item">
            <span class="activity-time">昨天 16:30</span>
            <span class="activity-content">系统更新成功</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts"></script>

<style scoped>
.dashboard-container {
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

h2 {
  font-size: 28px;
  color: #333;
  margin-bottom: 32px;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 24px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #1890ff;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #666;
}

.dashboard-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.chart-section, .recent-activities {
  background-color: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 20px;
}

.chart-placeholder {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  border-radius: 4px;
  color: #999;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.activity-time {
  font-size: 14px;
  color: #999;
}

.activity-content {
  font-size: 14px;
  color: #333;
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 20px;
  }
  
  .dashboard-content {
    grid-template-columns: 1fr;
  }
}
</style>